<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/public_header_main.jsp"%>
   
<link rel="stylesheet" href="${ctx_static }/home/sysconf/css/department.css">

   <h5 class="row-title departmentTitle">
       <img src="${ctx_static }/common/image/group-icon.png" alt="">
       <span>部门</span>
       <i class="fa  fa-plus-square-o pull-right addDepartment-btn"></i>
   </h5>

    <div class="row">
        <!--部门-->
        <div class="col-xs-6 col-sm-3">
            <div class="drop-down department">
                <ul class="nav sidebar-menu">
                <c:forEach items="${list}" var="department">
                	<li>
                		<a href="#" class="menu-dropdown">
                			<img src="${ctx_static }/common/image/group-icon.png" alt="">
                			<i class="fa fa-plus-square-o collapse-right pull-right"></i>
                			<span class="menu-text">${department.fullName}</span>
                			<input class="department-id" type="hidden" value="${department.departmentId}"/>
                			<input class="parentId" type="hidden" value="${department.parentId}"/>
                			<input class="companyId" type="hidden" value="${department.companyId}"/>
                			<input class="type" type="hidden" value="${department.type}"/>
                			<input class="enable" type="hidden" value="${department.enable}"/>
                			<input class="shortName" type="hidden" value="${department.shortName}"/>
                			<input class="description" type="hidden" value="${department.description}"/>
                			<input class="code" type="hidden" value="${department.code}"/>
                			<input class="parent-name" type="hidden" value="${department.parentName }"/>
                			<input class="fullPath" type="hidden" value="${department.fullPath }"/>
                		</a>
                			<c:set var="childs" value="${department.childs}" scope="request" />
							<c:import url="r_department.jsp" />
                	</li>
                </c:forEach>
                </ul>
            </div>
        </div>
        <!--部门/职位信息-->
        <div class="col-xs-6 col-sm-9">
            <!--S= 部门信息展示-->
            <div class="widget department-info department-information">
                <div class="widget-header">
                    <i class="widget-icon fa fa-gear"></i>
                    <span class="widget-caption">部门信息</span>
                    <div class="widget-buttons">
                        <a href="#">
                            <i class="glyphicon glyphicon-pencil department-edit "></i>
                        </a>
                        <a href="#">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="glyphicon glyphicon-remove"></i>
                        </a>
                    </div><!--Widget Buttons-->
                </div><!--Widget Header-->
                <div class="widget-body">
                    <table class="table">
                        <tbody>
                        <tr class = "hidden">
                            <td class="col-xs-3 text-right">ID:</td>
                            <td class="departmentId"></td>
                        </tr>
                        <tr>
                            <td class="col-xs-3 text-right">编号:</td>
                            <td class="code"></td>
                        </tr>
                        <tr>
                            <td class="col-xs-3 text-right">部门名称:</td>
                            <td class="fullName"></td>
                        </tr>
                         <tr>
                            <td class="col-xs-3 text-right">简称:</td>
                            <td class="shortName"></td>
                        </tr>
                        <tr>
                            <td class="col-xs-3 text-right">部门类型:</td>
                            <td class="type"></td>
                        </tr>
                        <tr>
                            <td class="col-xs-3 text-right">上级部门:</td>
                            <td class="parentName"></td>
                        </tr>
                        <tr>
                            <td class="col-xs-3 text-right">状态:</td>
                            <td class="enable"></td>
                        </tr>

                        <tr>
                            <td class="col-xs-3 describe text-right">描述:</td>
                            <td>
                                <textarea class="form-control description" rows="6" readonly></textarea>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!--Widget Body-->
            </div>
            <!--E= 部门信息展示-->
            <!--S= 添加部门信息-->
            <div class="widget department-info addDepartment hidden">
                <div class="widget-header">
                    <i class="widget-icon fa fa-gear"></i>
                    <span class="widget-caption">部门信息</span>
                    <div class="widget-buttons">
                        <a href="#">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="glyphicon glyphicon-remove"></i>
                        </a>
                    </div><!--Widget Buttons-->
                </div><!--Widget Header-->
                <div class="widget-body">
                    <form class="form-horizontal" id="departmentform" method="post">
                        <div class="form-group col-sm-12 col-xs-12">
                            <label for="code" class="col-sm-3 control-label">编号</label>
                            <div class="col-sm-9">
                                <input type="text" name="code" class="form-control"
                                       id="code" placeholder="请输入编号">
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label for="fullName" class="col-xs-3 control-label">部门名称</label>
                            <div class="col-xs-9">
                                <input type="text" name="fullName" class="form-control"
                                       id="fullName" placeholder="请输入部门名称(例:总裁办)">
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label for="shortName" class="col-xs-3 control-label">简称</label>
                            <div class="col-xs-9">
                                <input type="text" name="shortName" class="form-control" id="shortName" placeholder="请输入部门简称(例:总裁办)">
                                <input name="fullPath" type="hidden" value=""/>
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label for="type" class="col-xs-3 control-label">部门类型</label>
                            <div class="col-xs-9">
                                  <select name="type" class="form-control">
                                        <option value="1">公司</option>
                                        <option value="2">部门</option>
                                        <option value="3">分校</option>
                                  </select>
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label for ="parentName" class="col-xs-3 control-label">上级部门</label>
                            <div class="col-xs-9">
                                <input type="text" class="form-control parentName" name="parentName" readonly="readonly"/>
                               	<input name="parentId"  type="hidden" value=""/>
                               	<input name="companyId" type="hidden" value=""/>
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label class="col-xs-3 control-label">状态</label>
                            <div class="col-xs-9">
                                <div class="radio">
                                    <label>
                                        <input name="enable" type="radio" checked value="1">
                                        <span class="text">有效</span>
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input name="enable" type="radio" value="0">
                                        <span class="text">无效</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xs-12 col-md-12">
                            <label for="description" class="control-label col-xs-3">描述</label>
                            <div class="col-xs-9 col-ms-10">
                                <textarea class="form-control" name="description" rows="6"></textarea>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <div class="col-xs-3 col-xs-offset-3">
                                <button type="reset"
                                        class="btn btn-danger btn-lg form-control cancel-btn">取消
                                </button>
                            </div>
                            <div class="col-xs-3 col-xs-offset-1">
                                <button type="submit" class="btn btn-primary btn-lg form-control confirm-btn">
                                	确认
                                </button>
                            </div>
                        </div>
                    </form>
                </div><!--Widget Body-->
            </div>
            <!--E= 添加部门信息-->
            <!--S= 编辑部门信息-->
            <div class="widget department-info editDepartment hidden">
                <div class="widget-header">
                    <i class="widget-icon fa fa-gear"></i>
                    <span class="widget-caption">部门信息</span>
                    <div class="widget-buttons">
                        <a href="#">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="glyphicon glyphicon-remove"></i>
                        </a>
                    </div><!--Widget Buttons-->
                </div><!--Widget Header-->
                <div class="widget-body">
                    <form id="updateForm" class="form-horizontal" onsubmit="return updateDepartment();"> 
                    	<input name="departmentId" type="hidden" value=""/>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label class="col-sm-3 control-label">编号</label>
                            <div class="col-sm-9">
                                <input type="input" name="code" class="form-control code">
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label class="col-xs-3 control-label">部门名称</label>
                            <div class="col-xs-9">
                                <input type="input" name="fullName" class="form-control fullName">
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label class="col-xs-3 control-label">简称</label>
                            <div class="col-xs-9">
                                <input type="input" name="shortName" class="form-control shortName">
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label for="type" class="col-xs-3 control-label">部门类型</label>
                            <div class="col-xs-9">
                                  <select name="type" class="form-control type">
                                        <option value="1">公司</option>
                                        <option value="2">部门</option>
                                        <option value="3">分校</option>
                                  </select>
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label class="col-xs-3 control-label">上级部门</label>
                            <div class="col-xs-9">
                                <input type="text" name="parentName" class="form-control parentName" readonly>
                            </div>
                        </div>
                        <div class="form-group col-sm-12 col-xs-12">
                            <label class="col-xs-3 control-label">状态</label>
                            <div class="col-xs-9">
                                <div class="radio pull-left">
                                    <label>
                                        <input name="enable" type="radio" value="1" class="valid" checked>
                                        <span class="text">有效</span>
                                    </label>
                                </div>
                                <div class="radio pull-left">
                                    <label>
                                        <input name="enable" type="radio" value="0" class="invalid">
                                        <span class="text">无效</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xs-12 col-md-12">
                            <label class="control-label col-xs-3">描述</label>
                            <div class="col-xs-9 col-ms-10">
                                <textarea class="form-control description" name="description" rows="6"></textarea>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <div class="col-xs-3 col-xs-offset-3">
                                <button type="button"
                                        class="btn btn-danger btn-lg form-control cancel-btn">取消
                                </button>
                            </div>
                            <div class="col-xs-3 col-xs-offset-1">
                                <input type="submit" class="btn btn-primary btn-lg form-control confirm-btn" value="确认"/>
                            </div>
                        </div>
                    </form>
                </div><!--Widget Body-->
            </div>
        </div>
    </div>
</div>

<script src="${ctx_static }/home/sysconf/js/department.js"></script>
